/**
 * 十人桌
 * by wyy
 */
class tenDesk extends GameObject implements eui.UIComponent {
    private playerData;
    public playerList = {};
    public chair1: eui.Group;
    public chair2: eui.Group;
    public chair3: eui.Group;
    public chair4: eui.Group;
    public chair5: eui.Group;
    public chair6: eui.Group;
    public chair7: eui.Group;
    public chair8: eui.Group;
    public chair9: eui.Group;
    public chair10: eui.Group;

    constructor(p) {
        super();
        this.skinName = "resource/eui_skins/game_skins/tenDeskSkin.exml";
        this.playerData = p;
    }
    addToStage() { }
    onRemove() { }
    firstCreate() {
        let d = this.playerData.data.players;
        for (let i in d) {
            let p = new player(d[i]);
            let chairNum = Number(i).toString();
            this["chair" + chairNum].addChild(p);
            this.playerList[p.data.id] = p;
        }
    }
    addPlayer(d) {
        let p = new player(d);
        this["chair" + d.pos.toString()].addChild(p);
        this.playerList[d.uid] = p;
    }
}